Skip to content

更新先享卡订单

当用户在商户侧消费时,用户完成微信先享卡的目标或者领取奖励时,商户需要将信息同步至微信先享卡平台,用于在微信先享卡小程序展示及先享卡到期后的用户结算。

请求参数类型描述
out_order_nostring先享卡订单号
jsonobject声明请求的JSON数据结构
objectivesobject[]目标达成明细列表
objective_serial_nostring目标流水号
objective_idinteger先享卡目标ID
performance_descriptionstring履约描述
performance_typestring履约类型
countinteger目标数量
performance_timestring履约时间
remarkstring备注说明
rewardsobject[]奖励明细列表
reward_serial_nostring奖励流水号
reward_idinteger先享卡奖励ID
descriptionstring奖励描述
reward_typestring奖励类型
countinteger奖励数量
amountinteger奖励金额
reward_timestring奖励时间
remarkstring备注说明
php
$instance->v3->discountCard->orders->_out_order_no_->patchAsync([
  'out_order_no' => '233bcbf407e87789b8e471f251774f95',
  'json' => [
    'objectives' => [[
      'objective_serial_no' => '578354545',
      'objective_id' => 123456,
      'performance_description' => '购买商品',
      'performance_type' => 'INCREASE',
      'count' => 1,
      'performance_time' => '2015-05-20T13:29:35.120+08:00',
      'remark' => '特价商品',
    ],],
    'rewards' => [[
      'reward_serial_no' => '578354',
      'reward_id' => 123456,
      'description' => '购买商品',
      'reward_type' => 'INCREASE',
      'count' => 1,
      'amount' => 100,
      'reward_time' => '2015-05-20T13:29:35.120+08:00',
      'remark' => '特价商品',
    ],],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/discount-card/orders/{out_order_no}')->patchAsync([
  'out_order_no' => '233bcbf407e87789b8e471f251774f95',
  'json' => [
    'objectives' => [[
      'objective_serial_no' => '578354545',
      'objective_id' => 123456,
      'performance_description' => '购买商品',
      'performance_type' => 'INCREASE',
      'count' => 1,
      'performance_time' => '2015-05-20T13:29:35.120+08:00',
      'remark' => '特价商品',
    ],],
    'rewards' => [[
      'reward_serial_no' => '578354',
      'reward_id' => 123456,
      'description' => '购买商品',
      'reward_type' => 'INCREASE',
      'count' => 1,
      'amount' => 100,
      'reward_time' => '2015-05-20T13:29:35.120+08:00',
      'remark' => '特价商品',
    ],],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/discount-card/orders/{out_order_no}']->patchAsync([
  'out_order_no' => '233bcbf407e87789b8e471f251774f95',
  'json' => [
    'objectives' => [[
      'objective_serial_no' => '578354545',
      'objective_id' => 123456,
      'performance_description' => '购买商品',
      'performance_type' => 'INCREASE',
      'count' => 1,
      'performance_time' => '2015-05-20T13:29:35.120+08:00',
      'remark' => '特价商品',
    ],],
    'rewards' => [[
      'reward_serial_no' => '578354',
      'reward_id' => 123456,
      'description' => '购买商品',
      'reward_type' => 'INCREASE',
      'count' => 1,
      'amount' => 100,
      'reward_time' => '2015-05-20T13:29:35.120+08:00',
      'remark' => '特价商品',
    ],],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->discountCard->orders->_out_order_no_->patch([
  'out_order_no' => '233bcbf407e87789b8e471f251774f95',
  'json' => [
    'objectives' => [[
      'objective_serial_no' => '578354545',
      'objective_id' => 123456,
      'performance_description' => '购买商品',
      'performance_type' => 'INCREASE',
      'count' => 1,
      'performance_time' => '2015-05-20T13:29:35.120+08:00',
      'remark' => '特价商品',
    ],],
    'rewards' => [[
      'reward_serial_no' => '578354',
      'reward_id' => 123456,
      'description' => '购买商品',
      'reward_type' => 'INCREASE',
      'count' => 1,
      'amount' => 100,
      'reward_time' => '2015-05-20T13:29:35.120+08:00',
      'remark' => '特价商品',
    ],],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/discount-card/orders/{out_order_no}')->patch([
  'out_order_no' => '233bcbf407e87789b8e471f251774f95',
  'json' => [
    'objectives' => [[
      'objective_serial_no' => '578354545',
      'objective_id' => 123456,
      'performance_description' => '购买商品',
      'performance_type' => 'INCREASE',
      'count' => 1,
      'performance_time' => '2015-05-20T13:29:35.120+08:00',
      'remark' => '特价商品',
    ],],
    'rewards' => [[
      'reward_serial_no' => '578354',
      'reward_id' => 123456,
      'description' => '购买商品',
      'reward_type' => 'INCREASE',
      'count' => 1,
      'amount' => 100,
      'reward_time' => '2015-05-20T13:29:35.120+08:00',
      'remark' => '特价商品',
    ],],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/discount-card/orders/{out_order_no}']->patch([
  'out_order_no' => '233bcbf407e87789b8e471f251774f95',
  'json' => [
    'objectives' => [[
      'objective_serial_no' => '578354545',
      'objective_id' => 123456,
      'performance_description' => '购买商品',
      'performance_type' => 'INCREASE',
      'count' => 1,
      'performance_time' => '2015-05-20T13:29:35.120+08:00',
      'remark' => '特价商品',
    ],],
    'rewards' => [[
      'reward_serial_no' => '578354',
      'reward_id' => 123456,
      'description' => '购买商品',
      'reward_type' => 'INCREASE',
      'count' => 1,
      'amount' => 100,
      'reward_time' => '2015-05-20T13:29:35.120+08:00',
      'remark' => '特价商品',
    ],],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
out_order_nostring先享卡订单号
order_idstring微信支付服务订单号

参阅 官方文档

通过先享卡订单号查询订单

商户可以通过先享卡订单号或商户订单号查询用户目前的先享卡使用情况、订单状态,可用于对账或者界面展示。

请求参数类型描述
out_order_nostring先享卡订单号
php
$instance->v3->discountCard->orders->_out_order_no_->getAsync([
  'out_order_no' => '233bcbf407e87789b8e471f251774f95',
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/discount-card/orders/{out_order_no}')->getAsync([
  'out_order_no' => '233bcbf407e87789b8e471f251774f95',
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/discount-card/orders/{out_order_no}']->getAsync([
  'out_order_no' => '233bcbf407e87789b8e471f251774f95',
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->discountCard->orders->_out_order_no_->get([
  'out_order_no' => '233bcbf407e87789b8e471f251774f95',
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/discount-card/orders/{out_order_no}')->get([
  'out_order_no' => '233bcbf407e87789b8e471f251774f95',
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/discount-card/orders/{out_order_no}']->get([
  'out_order_no' => '233bcbf407e87789b8e471f251774f95',
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
out_order_nostring先享卡订单号
discount_card_idstring先享卡ID
out_trade_nostring商户订单号
appidstring公众账号ID
service_idstring服务ID
order_idstring微信支付服务订单号
transaction_idstring微信支付交易单号
openidstring用户标识
card_begin_timestring先享卡开始时间
card_end_timestring先享卡结束时间
card_namestring先享卡名称
objective_descriptionstring目标描述
reward_descriptionstring奖励描述
estimated_reward_amountinteger预估奖励金额
online_instructionsstring线上使用说明
offline_instructionsstring线下使用说明
statestring订单状态
total_amountinteger总金额
deduction_amountinteger扣除金额
settlement_amountinteger结算金额
create_timestring创建时间
pay_timestring支付时间
objectivesobject[]目标达成明细列表
objective_serial_nostring目标流水号
objective_idinteger先享卡目标ID
namestring目标名称
unitstring目标单位
performance_descriptionstring履约描述
performance_typestring履约类型
countinteger目标数量
performance_timestring履约时间
remarkstring备注说明
rewardsobject[]奖励明细列表
reward_serial_nostring奖励流水号
reward_idinteger先享卡奖励ID
namestring奖励名称
unitstring奖励单位
descriptionstring奖励描述
reward_typestring奖励类型
countinteger奖励数量
amountinteger奖励金额
reward_timestring奖励时间
remarkstring备注说明

参阅 官方文档

Published on the GitHub by TheNorthMemory